package com.tianji.learning.controller.admin;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.NoteAdminPageQuery;
import com.tianji.learning.domain.vo.AdminNoteVO;
import com.tianji.learning.domain.vo.NoteAdminVo;
import com.tianji.learning.service.ITjNoteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * <p>
 * 控制器
 * </p>
 *
 * @author author
 */
@Api(tags = "TjNote管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/notes")
public class TjNoteAdminController {

    private final ITjNoteService tjNoteService;
    
    @GetMapping("/page")
    public PageDTO<NoteAdminVo> page(NoteAdminPageQuery pageQuery) throws IOException {
        return tjNoteService.adminPageQuery(pageQuery);
    }

    @GetMapping("/{id}")
    public AdminNoteVO getAdminNote(@PathVariable Long id) {
        return tjNoteService.getAdminNote(id);
    }


}
